Welcome![Sign In][Sign Up]
Location:
Search - BREW S

Search list

[GUI Developbrew window manager

Description:

 

Objective
This topic describes how to create a windowed application that will share the display with other applications.
Brew® MP windowed applications need to be written differently than traditional Brew MP applications. Traditional Brew MP applications, when running in the foreground, occupy full screen space and can modify the display at any time. In the windowing framework, multiple applications share the display at the same time and are not allowed to modify the display arbitrarily. A windowed application also needs to create one or more widgets to be used to create the windows.
A windowed application needs to:
·                  Create and initialize one or more widgets to be passed to IWindowMgr_CreateWindow().
The application can implement its own IWidget, or it can make use of an existing IWidget.
·                  Handle the EVT_APP_START_WINDOW event (and create a window).
·                  Implement handlers for visibility changes, focus changes, and extent changes. The implementation of these handlers is dependent on the details of the application.
·                  Draw in two stages:
·                                  Tell the container that drawing is necessary (ICONTAINER_Invalidate()).
·                                  Draw only when told to draw by the container (IWIDGET_Draw()).
Note: A windowed application should not call any functions that modify IDisplay directly. This includes explicit IDisplay function calls or implicit updates, such as calls to IIMAGE_Draw() or ICONTROL_Redraw(). Drawing should happen only on demand, for example, when IWIDGET_Draw() is called for the widget used to create the window. Existing Widget based applications follow these guidelines and, with minor modifications, can be ported to the windowing framework.
Event handling
A windowed application must respond to these events:
EVT_APP_START_WINDOW and EVT_APP_START
A window-based application receives EVT_APP_START_WINDOW first. If the application returns TRUE for this event, the application does not receive EVT_APP_START. If an application needs to support both the environments (window based and non-window based), it should handle both events.
When the application receives EVT_APP_START_WINDOW, it should create one or more windows.
If creation of IWindowMgr0 fails while handling EVT_APP_START_WINDOW, the application should assume that the platform does not support window-based applications. In this case, the application should return FALSE and continue the application logic in the code for EVT_APP_START.
EVT_APP_SUSPEND and EVT_APP_RESUME
After an application returns TRUE for EVT_APP_START_WINDOW, it will not receive EVT_APP_SUSPEND and EVT_APP_RESUME as non-windowed Brew MP applications do. Instead, the application must check for window status events that are sent to the widget through EVT_WDG_SETPROPERTY events. For EVT_WDG_SETPROPERTY events, wParam indicates which property was set, and dwParam specifies the value of the property. When the AEEWindowMgrExt_PROPEX_STATE property has a value of AEEWindowMgrExt_STATE_VISIBLE, the window is visible.
EVT_WDG_WINDOWSTATUS
The EVT_WDG_WINDOWSTATUS event is sent to a widget to notify it about various window related status messages. AEEWindowStatus.h contains information on the meaning of various status messages.
Sample code location

ZIP filename
Location
Run app
hellowindowapp
Brew MP Library
·                       Download and extract the ZIP file.
·                       Compile the app.
·                       Run it on the Brew MP Simulator.

Example of a windowed application
In the hellowindowapp sample, HelloWindowApp_HandleEvent handles the EVT_APP_START_WINDOW event and creates soft key and pop-up windows:
   case EVT_APP_START_WINDOW:   
      DBGPRINTF("EVT_APP_START_WINDOW");
 
      // Create the softkey and popup windows
      HelloWindowApp_CreateSoftkey(pMe);
      HelloWindowApp_CreateOrActivatePopup(pMe);
 
      // Handling this event tells Brew that we are a windowing
      // application.
      return TRUE;  
HelloWindowApp_CreateSoftkey() creates the soft key widget, sets the color text of the widget, then calls HelloWindowApp_CreateWindow() to create the window.
   WidgetWindow *pWindow = &pMe->softkeyWindow;
  
   if (pWindow->piWindowWidget != NULL) return;
   pWindow->pszDbgName = "Softkey";
   pWindow->pMe = pMe;
  
   (void) ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_SoftkeyWidget,
            (void **) &pWindow->piWindowWidget);
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WidgetExtent extent = {0, HWA_SOFTKEY_HEIGHT};
      IWidget_SetExtent(pWindow->piWindowWidget, &extent);
   }
  
   (void) IWidget_SetBGColor(pWindow->piWindowWidget, MAKE_RGBA(200,200,200,255));
  
   // Now set the softkeys text
   {
      IWidget *piTextWidget = NULL;
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY1, &piTextWidget);
     
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Hover", TRUE);
      }
      RELEASEIF(piTextWidget);
 
      (void) IWidget_GetSoftkey(pWindow->piWindowWidget, PROP_SOFTKEY2, &piTextWidget);
      if (piTextWidget != NULL) {
         (void) IWidget_SetText(piTextWidget, L"Close", TRUE);
      }
      RELEASEIF(piTextWidget);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Softkey);  
HelloWindowApp_CreateWindow() creates the soft key window, as follows:
   int result;
   uint32 winId;
   AEEWindowProp propList[1];
  
   // Set custom window handler
   HANDLERDESC_Init(&pWindow->hdHandler, HelloWindowApp_WindowHandler, pWindow, NULL);
   IWIDGET_SetHandler(pWindow->piWindowWidget, &pWindow->hdHandler);
        
   propList[0].id = AEEWindowMgrExtProp_CLASS;
   propList[0].pbyLen = sizeof(winClass);
   propList[0].pby = (void *) &winClass;
     
   result = IWindowMgr_CreateWindow(pMe->piWindowMgr, (IQI*) (void *) pWindow->piWindowWidget,
      propList, ARR_SIZE(propList), &winId);
 
   if (result != SUCCESS) {
      DBGPRINTF("Window creation failed for %s: %d", pWindow->pszDbgName, result);
      HelloWindowApp_DestroyWindow(pWindow);
   } else {
      DBGPRINTF("Window %s created: id=%d", pWindow->pszDbgName, winId);
   }
HelloWindowApp_CreateOrActivatePopup() creates the widget for the pop-up window, then calls HelloWindowApp_CreateWindow() to create the pop-up window.
   pWindow->piWindowWidget = HelloWindowApp_CreateAndInitImageWidget(
                                pMe,
                                "popups.main" // Image as defined in appinfo.ini
                             );
 
   if (pWindow->piWindowWidget == NULL) return;
 
   {
      WExtent extent = {HWA_POPUP_WIDTH, HWA_POPUP_HEIGHT};
      IWIDGET_SetExtent(pWindow->piWindowWidget, &extent);
   }
 
   HelloWindowApp_CreateWindow(pMe, pWindow, AEEWindowMgrExt_CLASS_Popup);
Related information
·                  See Brew MP Widgets Technology Guide: Creating a Widgets application
·                  See Brew MP API Reference

Base version:
Brew MP 1.0
Tested version:
Brew MP 1.0
Phone tested:
No

 

Platform: | Size: 439828 | Author: bluecrest | Hits:

[BREWbrew_fk

Description: brew下的俄罗斯方块-brew of Rubik's cube
Platform: | Size: 331776 | Author: 何可伟 | Hits:

[BREWeluosi方块

Description: 经典的手机游戏源码俄罗斯方块,基于C+Brew开发-classic mobile gaming source of Rubik's cube, for the development of C Brew
Platform: | Size: 435200 | Author: 李晓慧 | Hits:

[BREWAppleMove

Description: BREW手机平台下的实例,实现苹果的移动。 通过按键盘的 “UP”、“Down”、“Left”、“Right”使整个苹果可以在屏幕上自由移动(Step=1),通过按“*”使苹果回到初始位置(屏幕的中间) 1,苹果是由4个对象组合而成,移动的时候如何成为一个整体 2、作为key事件驱动区分各个按键动作 3、苹果的每一次移动都是以上一次苹果的位置为参考 -BREW mobile platform example, the realization of Apple mobile. According to the keyboard through the "UP", "Down", "Left" and "Right" so that the whole Apple can move freely on the screen (Step = 1), adopted by the "*" Apple back to the initial position (screen middle) 1, Apple is 4 objects combination, the mobile how to be an overall 2, as key distinction between event-driven buttons all three movements, each time Apple's been more than a mobile Apple's position as a reference
Platform: | Size: 411648 | Author: shang | Hits:

[Other Riddle games吃星游戏

Description: 一个建立在c/s架构休闲brew游戏   服务器打印结果数据-a building in c/s leisure brew game server data printing results
Platform: | Size: 4046848 | Author: 毛毛 | Hits:

[Game Programducati

Description: 一个在brew 平台下开发的摩托车程序源代码,希望大家喜欢-a platform of the brew's motorcycle development program source code, hope you like
Platform: | Size: 1051648 | Author: seawolf | Hits:

[BREW13898362BREW_IMenudemo

Description: brew菜单资料,一个不错的程序,共享出来-brew menu, a good, shared out to s
Platform: | Size: 54272 | Author: han | Hits:

[OtherTorus_v0.15-src

Description: 一个CDMA手机BREW的3D游戏的源代码,希望能对大家有所帮助。-a CDMA mobile phone BREW 3D game's source code, we hope to help.
Platform: | Size: 1649664 | Author: wangchen | Hits:

[BREWifile

Description: 事例介绍brew中文件接口的操作,包括读文件、写文件、以及对文件的操作。适合初学者。-stories on File Interface brew operation, including a document reading, writing paper and the paper's operation. For beginners.
Platform: | Size: 599040 | Author: yilin | Hits:

[BREWsound

Description: 该源码是在VC++环境中利用BREW SDK开发的mp3播放程序 由于是在BREW SDK开发的,可以很好地移植到嵌入式设备中去-The source is VC++ Environment using BREW SDK to develop as a result of the mp3 player is developed in the BREW SDK, you can very well transplanted into embedded devices to
Platform: | Size: 2048 | Author: 李强 | Hits:

[BREWBREW

Description: 海信的BREW文档,很有用,入门必看的-Hisense s BREW documentation, very useful, entry-must-see
Platform: | Size: 299008 | Author: asfasf | Hits:

[BREWMMITraining

Description: 高通BREW平台MMI开发教程,想入门做CDMA或WCDMA的必备-Qualcomm s BREW platform for MMI development tutorial, I would like to do entry-CDMA or WCDMA essential
Platform: | Size: 360448 | Author: 一帆 | Hits:

[BREWformandwidgets

Description: BREW3.1窗口和控件的详细说明资料,就像VC的MSDN.-BREW3.1 window and a detailed description of control information, just like VC s MSDN.
Platform: | Size: 861184 | Author: 米良 | Hits:

[BREWBREW3.1.4

Description: BREW SDK 3.1。BREW应用程序的开发包。-BREW SDK 3.1. The package of BREW application development.
Platform: | Size: 9280512 | Author: Pikoona | Hits:

[BREWBREW_SDK_4.0.1_SP05

Description: The New BREW 4.0.1 SDK (English version). May be needed for those who deal with the most recent phones.
Platform: | Size: 13621248 | Author: Kraze | Hits:

[File Formatbrew-telephone-book

Description: BREW是在移动数据增值应用开发领域出现的新技术.阐述了BREW技术的特点和组成,介绍了手机电话薄的功能模块,分析了软件的结构及实现.然后详细阐述了在BREW平台下的手机电话薄的设计与开发过程,在VC++环境下基于BREW平台开发了手机应用程序,最后通过BREWSDK开发工具包中的Emulator在计算机上进行了手机仿真,最后通过编译器下载到手机上.实践表明,基于BREw的手机软件开发方便快捷,较好地满足了用户的个性化需求. -BREW is a value-added mobile data in the field of application and development of new technologies. BREW technology on the characteristics and composition of thin introduced the function of cellular telephone module, an analysis of the structure and implementation of software. And then described in detail in the BREW platform for mobile phones under the thin design and development process, in VC++ environment was developed based on the BREW platform for mobile applications, and finally through the development kit BREWSDK the Emulator in the computer simulation carried out on a mobile phone, and finally through compiler download to your phone. Practice shows that mobile phone-based software development BREw convenient and better meet the user' s individual requirements.
Platform: | Size: 199680 | Author: 毛义法 | Hits:

[File FormatBREW-IMAP4-mail

Description: 为了实现支持IMAP4协议的移动邮件客户端在智能手机上的应用,在VC++6.0环境下,采用了高通推出的专门为无线设备设计的BREW平台。提出了原子流程的概念,以降低程序间的耦合度,提高代码复用率。经在仿真环境下测试实验,实现了与Internet上多台常用邮件服务器的交互,并且运行稳定,可作为智能手机的一个组件应用于3G网络。-In order to achieve agreement in support of IMAP4 mail client for mobile phones in the smart application, in VC++6.0 environment, used to launch Qualcomm' s wireless devices designed specifically for the BREW platform. Put forward the concept of atomic processes in order to reduce the coupling between the procedure and improve the rate of code reuse. As in the simulation environment to test the experiment, realized with more than the commonly used Internet mail server interaction, and stable operation, can be used as a component of smart phones used in 3G networks.
Platform: | Size: 195584 | Author: 毛义法 | Hits:

[BREWtest2009

Description: This is a test sig file valid for 2009 year to upload and run brew applications on the phone
Platform: | Size: 2048 | Author: dedKalash | Hits:

[BREWSockPort

Description: This is a sample code for BREW s SMTP client.
Platform: | Size: 6144 | Author: raidun | Hits:

[BREWSPEC_DOC

Description: Brew各种机型的基本SIG,开发过程中必看。-Brew various models of the basic SIG, the development process must-see.
Platform: | Size: 954368 | Author: 宋震 | Hits:
« 12 3 »

CodeBus www.codebus.net